// @ts-ignore
/* eslint-disable */
import { request } from 'umi';

/** 获取 角色 POST */
export async function getRolePage(options?: { [key: string]: any }) {
  return request<BaseResponseBean.responsePage<AdminRoleData.Role[]>>('/admin/role/page', {
    method: 'POST',
    data: options || {},
  });
}

/** 获取 权限 树 POST */
export async function treePermissionForRoleId(options?: { [key: string]: any }) {
  return request<BaseResponseBean.responsePage<AdminPermissionData.Permission[]>>(
    '/admin/role/tree/permission',
    {
      method: 'POST',
      data: options || {},
    },
  );
}

/** 保存 角色 POST */
export async function saveRole(options?: { [key: string]: any }) {
  return request<BaseResponseBean.response<AdminRoleData.Role>>('/admin/role/save', {
    method: 'POST',
    data: options || {},
  });
}

/** 编辑 角色 POST */
export async function updateRole(options?: { [key: string]: any }) {
  return request<BaseResponseBean.response<AdminRoleData.Role>>('/admin/role/update', {
    method: 'POST',
    data: options || {},
  });
}

/** 删除 角色 POST */
export async function deleteRole(options?: { [key: string]: any }) {
  return request<BaseResponseBean.response<null>>('/admin/role/delete', {
    method: 'POST',
    data: options || {},
  });
}
